#!/usr/bin/sh

# The only argument to the script is source directory.
source_dir=$1

export PATH=@ANDROID_NDK@/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
export NDK_SYSROOT=@ANDROID_NDK@
export ANDROID_NDK_ROOT=@ANDROID_NDK@
export ANDROID_DEV=@ANDROID_NDK@/platforms/android-@CMAKE_ANDROID_API@/arch-arm/usr
export SYSROOT=@ANDROID_NDK@/platforms/android-@CMAKE_ANDROID_API@/arch-arm/
cd ${source_dir}
@REMOVE_mandroid_FLAG_FOR_CLANG@
./Configure --prefix=@CMAKE_CURRENT_BINARY_DIR@ --openssldir=./ssl android-arm no-asm shared -D__ANDROID_API__=@CMAKE_ANDROID_API@
make
cd -
